<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 150px;
            height: 300px;
            background-color: gold;
            float: left;
        }
        .box1{
            /* width: 200px;
            height: 200px;
            background-color: #bfa;
            float: left; */
            border: 1px solid red;
        }

        /* .clearfix::before,
        .clearfix::after{
            content: '';
            display: table;
            clear: both;
        } */
        .box1::before{
            content: '';
            display: block;
           
        }
        .box2{
            width: 100px;
            height: 100px;
            background-color: green;
            margin-top: 50px;
            float: left;

        }
    </style>
</head>
<body>
    <!-- <div class="box"></div> -->
    <div class="box1 clearfix">
        <div class="box2">2

        </div>
    </div>
</body>
</html>